UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zNerVJqNvu1W/fAiO3X2+htEKP+od13EyJu6B6A9ynI=' 
WHERE 
  key_id = '7cae280ec8088773c0c744124e404460339b749dd458080ee4ff6ff172a33dcc' 
  AND (
    token = 'zNerVJqNvu1W/fAiO3X2+htEKP+od13EyJu6B6A9ynI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039