UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p7US4rXPUlt7peOO+HmWV4mE4Y5smV+4/C5IHs7uGQM='
WHERE
key_id = '8e9c1b4bfe4b0bab3e7d4d6d18388cdf2813a625e3c278adda30f58b52ac0522'
AND (
token = 'p7US4rXPUlt7peOO+HmWV4mE4Y5smV+4/C5IHs7uGQM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)