UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Z/AE2JF4RCe+R1s+IoOao0577m/lPxXeLg9/WjHCVA='
WHERE
key_id = '64b016a578991f8738641e841d19700faaa93502b8e044010f465a37ad0cdbd1'
AND (
token = '2Z/AE2JF4RCe+R1s+IoOao0577m/lPxXeLg9/WjHCVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)