UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rOALUL60o0XjmPZIWQZdbZsFTyFt3SyE1QWgSbptnrg='
WHERE
key_id = 'fa7fae5c229b9abf5c6dace51dda2f09d59a61a5ee28b23e139e47d7b2671ae8'
AND (
token = 'rOALUL60o0XjmPZIWQZdbZsFTyFt3SyE1QWgSbptnrg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)