UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ubFggKQKQxottdJ+B6K+exZpy0twAmPzG2IXCzDBlNI='
WHERE
key_id = 'c1f604885882fb48d5c0723e7c749af40eab31861fc3b9c4363ddf5a32b75a5c'
AND (
token = 'ubFggKQKQxottdJ+B6K+exZpy0twAmPzG2IXCzDBlNI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)