UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qNMPXtA9HY4IdLdxTOeQ+AyTNWvWG15ocwOGdhgL0JE=' 
WHERE 
  key_id = '25b817b224d6a7ec891e8c4cb1f41c13d882373306877a53c8119a133cef84b6' 
  AND (
    token = 'qNMPXtA9HY4IdLdxTOeQ+AyTNWvWG15ocwOGdhgL0JE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00087