UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'p+qqkto0CPxjHMI+V3aiw10hRQ3yN2QrNlkxNMM061k=' 
WHERE 
  key_id = '2c89fa6d0c6a97193055518e75ad4692038d902ddded36dde0a516a0d3b4c2a9' 
  AND (
    token = 'p+qqkto0CPxjHMI+V3aiw10hRQ3yN2QrNlkxNMM061k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031