UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4NNhKG3JEskVzbHNfl7+5P8xbE8Izm8OWeOlpinAGWo='
WHERE
key_id = '2e60b85dc9aab8b1cd4de175db3456024c1ead77686ffd582046fb82d2405dfc'
AND (
token = '4NNhKG3JEskVzbHNfl7+5P8xbE8Izm8OWeOlpinAGWo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)