UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RvQECHVtPOhtp48sf7X9lHbF4zjDl02P7+gYKz1zZnk='
WHERE
key_id = '6b93f4263b7b0279b6b2f3ff2f0676d38cf56d5e51f74a0ab16d9b0fd93537ea'
AND (
token = 'RvQECHVtPOhtp48sf7X9lHbF4zjDl02P7+gYKz1zZnk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)