UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oVOrHrGC3YWlxlnWXWCczH9PoTrDDYDwL7CmvlposYo='
WHERE
key_id = 'e92b1cadc6bdc903689d8f7b2abe0a38448bc4aa2061fe3fc9775d8f21be520c'
AND (
token = 'oVOrHrGC3YWlxlnWXWCczH9PoTrDDYDwL7CmvlposYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)