UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LOecsyEOF7gpj+5UAdoXbT4Fsvn62jDSR5XbDXc69PE=' 
WHERE 
  key_id = '75a85b67f465bf830d48320acf7db5b64fb1fff6c26fed3b93889458528aa0d7' 
  AND (
    token = 'LOecsyEOF7gpj+5UAdoXbT4Fsvn62jDSR5XbDXc69PE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046