UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xzzv8a92FoNhUPPXolHPwtFqE8LsdFtnAGpg5GuBwlY=' 
WHERE 
  key_id = 'c752c00d735991f42a4b828e7901df3af24e21be38b6843fdc114f344aa881ae' 
  AND (
    token = 'Xzzv8a92FoNhUPPXolHPwtFqE8LsdFtnAGpg5GuBwlY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014