UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eiHnXlcBWEVRIKd+j40aNtEhmDx3x2YDKck1V22XcQE=' 
WHERE 
  key_id = '25da506b6e9524fd48b8d93f2246c3ed0c126e74b06f3b24347cf9b53b2cfb67' 
  AND (
    token = 'eiHnXlcBWEVRIKd+j40aNtEhmDx3x2YDKck1V22XcQE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040