UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iTCOzycvr/neWnmfnWiQJUJT/x7Qh4l5SGifuFVoNXE=' 
WHERE 
  key_id = '1097c656ecec0519759c00d6e21aee598c638781bb31e2bf415fff94645d2d1d' 
  AND (
    token = 'iTCOzycvr/neWnmfnWiQJUJT/x7Qh4l5SGifuFVoNXE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043