UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fZ7/CHICDirdhXWQ0+gdSAkNRdGqLB7uKSCoDh0BReI='
WHERE
key_id = 'b1db89575d6d9ded5d63823815e3a57b8a2f2e592c956f426d49cc73884f8de7'
AND (
token = 'fZ7/CHICDirdhXWQ0+gdSAkNRdGqLB7uKSCoDh0BReI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)