UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '93UPRgeJwdfiq7ixdIw5udiB+pMvJSzld9FF7wTvqW4='
WHERE
key_id = 'a1b63ab37c54147142e0de642e3b0a65fae0e6a8b970af8c6126b79bc1b69849'
AND (
token = '93UPRgeJwdfiq7ixdIw5udiB+pMvJSzld9FF7wTvqW4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)