UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's3EbqEDkfMrBZkBl7oSapKQ9NbcK5itZgc8rpDTb0wI=' 
WHERE 
  key_id = '6f4384dd50b88a480baed9ed4f57ddf8170342df4c9cca3e9290a954ab00e0b8' 
  AND (
    token = 's3EbqEDkfMrBZkBl7oSapKQ9NbcK5itZgc8rpDTb0wI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034