UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DQfR0mNSCXUE2KlMPFvaLdgneDlr12hzsVvatTEkWK8=' 
WHERE 
  key_id = '49ae3d6f8c915767f5a83fea70dbb38f03d3dfe9f61a61b0ffa2b944bcf9df84' 
  AND (
    token = 'DQfR0mNSCXUE2KlMPFvaLdgneDlr12hzsVvatTEkWK8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034