UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Me0KOuxvlsPyL/FovFqJbJZGeMNkHY25oB5mKGiMrQ='
WHERE
key_id = '5f2e0bbfc7f1c1ec046c1508735418052840becbdbeb81020dd0488f3b9a2f05'
AND (
token = '9Me0KOuxvlsPyL/FovFqJbJZGeMNkHY25oB5mKGiMrQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)