UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VUYgpSEBMMTZG1C/9ggXASeZypusQYxqJtql62OG/5s=' 
WHERE 
  key_id = '7a0465bb230d0c22b29b8f53a353c929040c80e2c74f35154f5eb52be52ac6c5' 
  AND (
    token = 'VUYgpSEBMMTZG1C/9ggXASeZypusQYxqJtql62OG/5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039