UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fZHrugRvGsVHcvGNRrCilOYs3fCzr3s0QegG0hFr/Ck='
WHERE
key_id = '22be3e99297c20be0c75f26d5960acd9366051f38a27ad4d6ddc4097f4c5efc0'
AND (
token = 'fZHrugRvGsVHcvGNRrCilOYs3fCzr3s0QegG0hFr/Ck='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)