UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'unP+yEkRd3ZDrOZYtR60vnGN4i8zUqoojDDHVjCPDH8='
WHERE
key_id = '2898b921de0a83b4cced0ff4ab2ed8c7093fa6010a1472094c623eef8cd6ba2e'
AND (
token = 'unP+yEkRd3ZDrOZYtR60vnGN4i8zUqoojDDHVjCPDH8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)