UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mXDqGza0IKuNZOCQVcpRI+2jevrtk6d3yaOaRzgtQ0I=' 
WHERE 
  key_id = '3cd3fb413df2bb92d50f02adae93c1a83ba63072bc96caa2ad6015941a2a5290' 
  AND (
    token = 'mXDqGza0IKuNZOCQVcpRI+2jevrtk6d3yaOaRzgtQ0I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031