UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TadY2nlVL9qDrtpSXx/7eStqBk0/UX6perL/c+eR5Fs='
WHERE
key_id = 'fc53db0f259b8be8896c74af8c18150eaeb32593b1672f5df771351b090d2f3a'
AND (
token = 'TadY2nlVL9qDrtpSXx/7eStqBk0/UX6perL/c+eR5Fs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)