UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZbeNJQOP9tdRG2x/KYLVHh9dFHN7DJOBvTW+7Ip2QVA='
WHERE
key_id = 'f4378f5cf4305514ae278e1e8f73ce1b7733c3047d35e6798976219e8494b1fa'
AND (
token = 'ZbeNJQOP9tdRG2x/KYLVHh9dFHN7DJOBvTW+7Ip2QVA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)