UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'k2hc76cD+45uq+2Xl1Y9oO2ssKiU4ChhZYZGput7DEg=' 
WHERE 
  key_id = '55dffa5466ba243289c8b3a25a3a64b1a46d5b5681f43318fa2260600352a16b' 
  AND (
    token = 'k2hc76cD+45uq+2Xl1Y9oO2ssKiU4ChhZYZGput7DEg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039