UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Khr7CFDSR9WIxwx4p4n8ujSIuZUH6bLdmBoARbxping='
WHERE
key_id = 'fd881ad3c1f90ce6fc3a55e740d3ebf262cebf9b8806115fb83bf6fc0e5db8ae'
AND (
token = 'Khr7CFDSR9WIxwx4p4n8ujSIuZUH6bLdmBoARbxping='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)