UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PRFds9JZoYogSY7UracxYwu7R2L7zXfdWyANiR9OZEs='
WHERE
key_id = '9e8c94650f6b14644774d68ee284e4a4d16a348ab0a09f2a9acdfb3d094a07c8'
AND (
token = 'PRFds9JZoYogSY7UracxYwu7R2L7zXfdWyANiR9OZEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)