UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5PylVkuKTrFlL+43x7vztIk7QovXxChDQevusYltJSk='
WHERE
key_id = '08e1070d4c393ec4985c1256cb6b9c2d6101f97e5851196e34ef63d4c5a6c3e9'
AND (
token = '5PylVkuKTrFlL+43x7vztIk7QovXxChDQevusYltJSk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)