UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'W/hkdxgLrEzTfs/phPCXRRS9pSeN5yRXNF4OWl14HQw=' 
WHERE 
  key_id = 'de6a5598de01ee572007d7c6d2175d4e684ff11c09f4c70cce4b285fdcbb80d7' 
  AND (
    token = 'W/hkdxgLrEzTfs/phPCXRRS9pSeN5yRXNF4OWl14HQw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029