UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yyjAGTvIP7W/2s1lfhTfbt1oDF+gbAWaH3i9ciUZgVk='
WHERE
key_id = '440580cf7759a7202f23b67ab94c5c638f859032f1633bb0ab12af1edf661dac'
AND (
token = 'yyjAGTvIP7W/2s1lfhTfbt1oDF+gbAWaH3i9ciUZgVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)