UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gKBAQOyiKF7alHEaTobE8wSGXV3qu2XPCVOTbX869Kc=' 
WHERE 
  key_id = '7363ab2a697a81b49d538d5d8b72c8b00bda957f2de4395d9d62de353c7975c0' 
  AND (
    token = 'gKBAQOyiKF7alHEaTobE8wSGXV3qu2XPCVOTbX869Kc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043