UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3PjhN4dXkPABW3chSlxKZXGCXUwTJ7eXDBhbS+21Zcg='
WHERE
key_id = '089d0fb5ab8256224146111725df32ba2b15889a6196cc23425ea5fb597742dd'
AND (
token = '3PjhN4dXkPABW3chSlxKZXGCXUwTJ7eXDBhbS+21Zcg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)