UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kWHYNRsOYz0qidbig0M6MvoWwkCOTjr12oCpnTVj7kA=' 
WHERE 
  key_id = '43d2541ceb1bdbbb086a3dc161606708b09de7d774a38c57a058f852e59bc1ea' 
  AND (
    token = 'kWHYNRsOYz0qidbig0M6MvoWwkCOTjr12oCpnTVj7kA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032