UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'C1G+sq/SgduMzj6mggkDwGwC5CcqNRh+6rJwfiJB10Y='
WHERE
key_id = 'e8b41edcda1dc78715d5ed581dad80f483ed176f4e0f0bd43f7b10d6d2d971a2'
AND (
token = 'C1G+sq/SgduMzj6mggkDwGwC5CcqNRh+6rJwfiJB10Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)