UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lkc+n//isdzfhRw+IsWmACuy2bYPrfZEWCneW2YlImE='
WHERE
key_id = '1664a0ecb81d491e40592be20f1f808e290df799ff63a8b02b314638321d1834'
AND (
token = 'Lkc+n//isdzfhRw+IsWmACuy2bYPrfZEWCneW2YlImE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)