UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GxXvPidNc9+kDMnP1HxY/hObGNoK7velKXFgn3iQ7v8=' 
WHERE 
  key_id = '72acf945d22a3d35e16d65de8ab2aa1e51268e307a142b56acb5c1e70b8adeae' 
  AND (
    token = 'GxXvPidNc9+kDMnP1HxY/hObGNoK7velKXFgn3iQ7v8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017