UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RGgmX2uh938ye25e/WH9btr1BJ3h0xqJzHBkXYmNyBc=' 
WHERE 
  key_id = '692ce3e241dccb7235795f615486bf8976cea8d8747d356ae6ec3fe483f0ee8a' 
  AND (
    token = 'RGgmX2uh938ye25e/WH9btr1BJ3h0xqJzHBkXYmNyBc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033