UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8K9HiwCUfZgNUMn9lFeBnmnZu8oSnoum+l2pWXwa018='
WHERE
key_id = 'e80f136bad9f27a40fa21ddeca88502e5dbf5598f8cdeb5c4c618b8add836f92'
AND (
token = '8K9HiwCUfZgNUMn9lFeBnmnZu8oSnoum+l2pWXwa018='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)